<template>
	<view class="container">
		<view class="card">
			<view class="title">
				淄博市中心医院
			</view>
			<view class="info">
				<view class="w50">
					姓名：{{data.patientName}}
				</view>
				<view class="w50">
					性别：{{data.patientSex==1?'男':'女'}}
				</view>
				<view class="w50">
					身高：{{data.height || ''}}cm
				</view>
				<view class="w50">
					体重：{{data.weight  || ''}}kg
				</view>
				<view class="w50">
					科室：中医内科
				</view>
				<view class="w50">
					年龄：{{data.patientAge}}岁
				</view>
			</view>
		</view>
		<view class="card">
			<view class="title">
				诊断结果
			</view>
			<view class="info">
				{{data.diagnosis}}
			</view>
		</view>
		<view class="card">
			<view class="title">
				rp 中药饮片
			</view>
			<view class="info">
				<view class="w50" v-for="n in showdrugName">
					{{n.name}}{{n.dosage}} <text v-if="n.DecoctionMethod">({{n.DecoctionMethod}})</text>
				</view>
				<view class="row">
					<text>用法：</text>
					共{{showapply.dose}}剂，{{showapply.operationMethod}}，{{showapply.dosageNum}}，{{showapply.usageCount}}，{{showapply.perUse}}
				</view>
				<view class="row" v-if="data.machining">
					<text>加工：</text>
					{{data.machining}}
				</view>
				<view class="row" v-if="data.medicalAdvice">
					<text>医嘱：</text>
					{{data.medicalAdvice}}
				</view>
			</view>
		</view>
		<view class="card">
			<view class="title">
				备注
			</view>
			<view class="info">
				1、处方有效期为3天; <br />
				2、支持凭本处方到线下药店购药或将本处方上传至其他网上购药平台(如京东、阿里等)找医生抄方后购药;<br />
				3、如需医保报销，您需凭本处方到附近线下实体医院抄方购药<br />
			</view>
		</view>
	</view>
</template>

<script>
	import {
		queryPrescriptionInfoDetail
	} from '@/api/index.js'
	export default {
		data() {
			return {
				data: {},
				id: "",
				showdrugName: {},
				showapply: {},
				type: 1,
				butShow: true
			};
		},
		onLoad(e) {
			this.id = e.id
			this.queryPrescriptionInfoDetail()
		},
		methods: {
			queryPrescriptionInfoDetail() {
				queryPrescriptionInfoDetail({
					id: this.id
				}).then(res => {
					this.data = res.data
					this.showdrugName = JSON.parse(res.data.drugName)
					this.showapply = JSON.parse(res.data.apply)
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.btnBox {
		position: fixed;
		width: 750rpx;
		bottom: 0;
		height: 162rpx;
		background: #FFFFFF;
		padding: 0 50rpx;
		box-sizing: border-box;

		.updata {
			width: 218rpx;
			height: 100rpx;
			background: #FFFFFF;
			border-radius: 50rpx;
			font-weight: 500;
			font-size: 28rpx;
			color: #3B6CFE;
			border: 1px solid #3B6CFE;
		}

		.add {
			width: 364rpx;
			height: 100rpx;
			background: #3B6CFE;
			border-radius: 50rpx;
			font-weight: 500;
			font-size: 28rpx;
			color: #FFFFFF;
		}
	}

	.card {
		margin-top: 30rpx;
		width: 750rpx;
		min-height: 122rpx;
		background: #FFFFFF;
		padding: 0 30rpx 30rpx;
		box-sizing: border-box;

		.title {
			height: 95rpx;
			line-height: 95rpx;
			font-weight: bold;
			font-size: 34rpx;
			color: #333333;
			border-bottom: 1px solid #EEEEEE;
		}

		.info {
			padding-top: 30rpx;
			font-weight: 500;
			font-size: 28rpx;
			color: #333333;
			display: flex;
			flex-wrap: wrap;

			.w50 {
				width: 50%;
				margin-bottom: 20rpx;
			}

			.row {
				margin-top: 20rpx;
				width: 100%;
				display: flex;

				text {
					width: 100rpx;
				}
			}
		}
	}
</style>